<?php
require_once("../inc/conn.php");
require_once("../inc/session.php");
//获取传递来的id  数组
$getid=$_POST["sl"];
//处理数组成为字符串
$str=implode(",",$getid);

//echo $str;
//定义删除语句
$sql="delete from userinfo where id in(".$str.")";
//执行sql
$rs=$conn->query($sql);

//统计删除
$total=$rs->affected_rows;

//判断成功是否
if($rs){
	echo "<script>alert('删除成功！共有".$total."条被删除。');location.href='userlist.php';</script>";
}else{
	echo "<script>alert('删除失败！');location.href='userlist.php';</script>";
}
?>